//消息的请求封装
import request from "@/utils/http.ts"

//1.添加Offer
export const addOfferAPI = (data: any) => {
    return request({
        url: 'offer/addOffer',
        method: 'post',
        data: {
            offerJobseekerId: data.offerJobseekerId,
            offerJobId: data.offerJobId,
            offerEmployerId: data.offerEmployerId,
            offerStatus: data.offerStatus,
            offerRemarks: data.offerRemarks,
            offerEndTime: data.offerEndTime,
        }
    })
}

//2.修改Offer状态
export const updateOfferStatusAPI = (data: any) => {
    return request({
        url: 'offer/updateOfferStatus',
        method: 'post',
        params: {
            offerId: data.offerId,
            offerStatus: data.offerStatus,
        }
    })
}

//3.修改Offer信息
export const updateOfferAPI = (data: any) => {
    return request({
        url: 'offer/updateOffer',
        method: 'post',
        data: {
            offerId: data.offerId,
            offerStatus: data.offerStatus,
            offerRemarks: data.offerRemarks,
            offerEndTime: data.offerEndTime,
        }
    })
}

//4.分页查询Offer信息
export const pageOfferAPI = (data: any) => {
    return request({
        url: 'offer/pageOffer',
        method: 'post',
        data: {
            pageCurrent: data.pageCurrent,//当前页码
            pageSize: data.pageSize,//每页显示条数
            offerJobseekerId: data.offerJobseekerId,//求职者id
            offerEmployerId: data.offerEmployerId,//招聘者id
        }
    })
}

//5.查询Offer信息根据offerId
export const getOfferDetailByIdAPI = (data: any) => {
    return request({
        url: 'offer/getOfferDetailById',
        method: 'post',
        params: {
            offerId: data.offerId,
        }
    })
}
